﻿<script type="text/javascript">
    $(document).ready(function () {
        showProgressBar();
        $("#project_DropDownList").change(function () {
            $.ajax({
                type: "POST",
                url: "/Defect/DefectFields",
                dataType: "html",
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify({ project: $(this).val() }),
                success: function (data) {
                    $("#partial").replaceWith("<div id=\"partial\">" + data + "</div>");
                },
                error: function () {
                    var result = $('#result').text;
                    alert(result);
                }
            });
        });
        hideProgressBar();
    });
</script>

@{
    ViewBag.Title = "Defect";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title</h1>
                <h2>@ViewBag.Message</h2>
            </hgroup>
            <p>
                Put any other info here about how to use the page I suppose.
            </p>
        </div>
    </section>
}

@Html.DropDownList("project_DropDownList", (List<SelectListItem>)ViewBag.Projects)
<div id="partial"></div>
@ViewBag.Response

